﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CNVP.Framework.Utils;

namespace CNVP.JShop.Web.Admin.CommonWindows
{
    public partial class AjaxPostAddress : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["ID"];
            if (string.IsNullOrEmpty(id)|| !Public.IsNumber(id))
            {
                id ="0";
                
            }
            if (!IsPostBack)
            {
                PostInfo(Convert.ToInt32(id));
            }
        }
        private void PostInfo(int id)
        {
            Model.CNVP_PostAddress model = new BLL.CNVP_PostAddress().GetSingle_CNVP_PostAddressById(id);
            if (model != null)
            {
                string html = "";
                html += "	<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" class=\"division\">";
                html += "		<tr>";
                html += "			<th>";
                html += "				姓名：</th>";
                html += "			<td>";
                html += "				" + model.PostTrueName + "</td>";
                string Address_Str = new BLL.CNVP_Province().GetSingle_CNVP_ProvinceByCode(model.Province).Name + "" + new BLL.CNVP_City().GetSingle_CNVP_CityByCode(model.City).Name;
                Address_Str += new BLL.CNVP_Area().GetSingle_CNVP_AreaByCode(model.Area).Name;
                html += "			<th>";
                html += "				地区：</th>";
                html += "			<td>";
                html += "				" + Address_Str + "</td>";
                html += "		</tr>";
                html += "		<tr>";
                html += "			<th>";
                html += "				邮编：</th>";
                html += "			<td>";
                html += "				" + model.ZipCode + "</td>";
                html += "			<th>";
                html += "				地址：</th>";
                html += "			<td>";
                html += "				" + Address_Str + "" + model.PostAddress + "</td>";
                html += "		</tr>";
                html += "		<tr>";
                html += "			<th>";
                html += "				手机：</th>";
                html += "			<td>";
                html += "				" + model.MobilePhone + "</td>";
                html += "			<th>";
                html += "				电话：</th>";
                html += "			<td>";
                html += "				" + model.Phone + "</td>";
                html += "		</tr>";
                html += "	</table>";
                Response.Write(html);
            }
        }
    }
}